﻿@using SCMS.Resource
@model IEnumerable<SCMS.UI.Models.ViewTAForms>

@if (Model.Count() > 0)
{
    <div id="tablewrapper">
        <div id="tableheader">
            <div class="search">
                <b>@Resources.Global_String_SearchBy:</b><br />
                <select id="columns5" onchange="sorter5.search('query5')">
                </select>
                <input type="text" id="query5" onkeyup="sorter5.search('query5')" />
            </div>
            <span class="details">
                <div>
                    @Resources.Global_String_Records <span id="startrecord5"></span>-<span id="endrecord5"></span> @Resources.Global_String_Of <span id="totalrecords5">
                    </span>
                </div>
            </span>
        </div>
        <br />
        <br />
        <br />
        <table width="98%" align="center" cellpadding="0" cellspacing="0" border="0" id="table5"
            class="tinytable">
            <thead>
                <tr>
                    <th>
                        <h3>@Resources.Global_String_TAFNo</h3>
                    </th>
                    <th>
                        <h3>@Resources.Global_String_Traveler</h3>
                    </th>
                    <th>
                        <h3>@Resources.FundPosting_TAFList_TravelMeans</h3>
                    </th>
                    <th>
                        <h3>@Resources.FundPosting_TAFList_TravelStartDate</h3>
                    </th>
                    <th>
                        <h3>@Resources.FundPosting_TAFList_TravelEndDate</h3>
                    </th>
                    <th>
                        <h3>@Resources.Global_String_AuthDate</h3>
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr onclick="sendRequest('/TravelAuth/ViewTravelAuthFormsDetails?id=@item.TAuthFormEntity.Id&checkPost=true', 'FundPostingDiv', 'loading')" style=" cursor:pointer;">
                        <td>
                            @item.TAuthFormEntity.RefNumber
                        </td>
                        <td align="left">
                            @if (item.TAuthFormEntity.Staff4 != null)
                            {
                                @(item.TAuthFormEntity.Staff4.Person.FirstName + " " + item.TAuthFormEntity.Staff4.Person.OtherNames)                         
                            }
                        </td>
                        <td>
                            @item.TAuthFormEntity.TravellMeans
                        </td>
                        <td align="right">
                            @if (item.TAuthFormEntity.TravelStartDate.HasValue)
                            {
                                @item.TAuthFormEntity.TravelStartDate.Value.ToString("dd/MM/yyyy")
                            }
                        </td>
                        <td align="right">
                            @if (item.TAuthFormEntity.TravelEndDate.HasValue)
                            {
                                @item.TAuthFormEntity.TravelEndDate.Value.ToString("dd/MM/yyyy")
                            }
                        </td>
                        <td align="right">
                            @if (item.TAuthFormEntity.AuthorizedOn.HasValue)
                            {
                                @item.TAuthFormEntity.AuthorizedOn.Value.ToString("dd/MM/yyyy")
                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        <div id="tablefooter">
            <div id="tablenav5">
                <div>
                    <img src="../../Content/images/pager/first.gif" width="16" height="16" alt="@Resources.Global_String_FirstPage"
                        onclick="sorter5.move(-1,true)" />
                    <img src="../../Content/images/pager/previous.gif" width="16" height="16" alt="@Resources.Global_String_PreviousPage"
                        onclick="sorter5.move(-1)" />
                    <img src="../../Content/images/pager/next.gif" width="16" height="16" alt="@Resources.Global_String_NextPage"
                        onclick="sorter5.move(1)" />
                    <img src="../../Content/images/pager/last.gif" width="16" height="16" alt="@Resources.Global_String_LastPage"
                        onclick="sorter5.move(1,true)" />
                </div>
                <div>
                    <select id="pagedropdown">
                    </select>
                </div>
                <div>
                    <a href="javascript:sorter5.showall()">@Resources.Global_String_ViewAll</a>
                </div>
            </div>
            <div id="tablelocation">
                <div>
                    <select onchange="sorter5.size(this.value)">
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="20" selected="selected">20</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>
                    <span>@Resources.Global_String_EntriesPerPage</span>
                </div>
                <div class="page">
                    @Resources.Global_String_Page <span id="currentpage5"></span>@Resources.Global_String_Of <span id="totalpages5"></span>
                </div>
            </div>
        </div>
    </div>
}
else
{
    <i style="text-align: center;">@Resources.FundPosting_TAFList_NoTAFsToPost</i>
}
 
